{extend name="public/base" /}
{block name="body"}
<body class="hold-transition skin-purple sidebar-mini">

<div class="wrapper">

  <!-- 内容区域 -->
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        企业管理
        <small>Company Tables</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="home.html"><i class="fa fa-dashboard"></i>主页</a></li>
        <li><a href="#">系统管理</a></li>
        <li class="active">企业管理</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
      <div class="row">
        <div class="col-xs-12">
          <!-- 待审批企业 -->
          <div class="box box-primary">
            <div class="box-header with-border">
              <i class="fa fa-cube"></i>
              <h3 class="box-title">待审批企业</h3>
            </div>

            <div class="box-body">

              <!-- 数据表格 -->
              <div class="table-box">

                <!--数据列表-->
                <table style="text-align: center;" id="pList" class="table table-bordered table-striped table-hover dataTable">
                  <thead>
                  <tr>
                    <th class="text-center">企业ID</th>
                    <th class="text-center">企业名称</th>
                    <th class="text-center">企业类别</th>
                    <th class="text-center">企业诚信</th>
                    <th class="text-center">企业品牌</th>
                    <th class="text-center">企业产品</th>
                    <th class="text-center">村镇意见</th>
                    <th class="text-center">县市审核</th>
                  </tr>
                  </thead>
                  <tbody>

                  {volist name="pendingList" id="item"}
                  <tr>
                    <td>{$item.cID}</td>
                    <td>{$item.name}</td>
                    <td>{$item.cClass}</td>
                    <td>{$item.cCredit}</td>
                    <td>{$item.cBrand}</td>
                    <td>{$item.cGoods}</td>
                    <td>
                      {if condition="$item.cOpinion eq 1"}
                      <span class="label label-success">Approved</span>
                      {elseif condition="$item.cOpinion eq 2"}
                      <span class="label label-warning">Pending</span>
                      {else /}
                      <span class="label label-danger">Denied</span>
                      {/if}
                    </td>
                    <td class="text-center">
                      <button type="button" class="btn btn-success btn-xs btn_approve" onclick="btnApproveConfirm(this)" name="company">通过</button>
                      <button type="button" class="btn btn-danger btn-xs btn_deny" onclick='btnDenyConfirm(this)' name="company">不通过</button>
                    </td>
                  </tr>
                  {/volist}

                  </tbody>
                </table>
                <!--数据列表/-->

              </div>
              <!-- 数据表格 /-->

            </div>
            <!-- /.box-body -->

          </div>
          <!-- 待审批企业 /-->
          <!-- /.box -->

          <!-- 全部企业 -->
          <div class="box box-success">
            <div class="box-header with-border">
              <i class="fa fa-book"></i>
              <h3 class="box-title">全部企业</h3>
            </div>

            <div class="box-body">

              <!-- 数据表格 -->
              <div class="table-box">

                <!--数据列表-->
                <table style="text-align: center;" id="aList" class="table table-bordered table-striped table-hover dataTable">
                  <thead>
                  <tr>
                    <th class="text-center">企业ID</th>
                    <th class="text-center">企业名称</th>
                    <th class="text-center">企业类别</th>
                    <th class="text-center">企业诚信</th>
                    <th class="text-center">企业品牌</th>
                    <th class="text-center">企业产品</th>
                    <th class="text-center">村镇意见</th>
                    <th class="text-center">县市审核</th>
                  </tr>
                  </thead>
                  <tbody>

                  {volist name="allList" id="item"}
                  <tr>
                    <td>{$item.cID}</td>
                    <td>{$item.name}</td>
                    <td>{$item.cClass}</td>
                    <td>{$item.cCredit}</td>
                    <td>{$item.cBrand}</td>
                    <td>{$item.cGoods}</td>
                    <td>
                      {if condition="$item.cOpinion eq 1"}
                      <span class="label label-success">Approved</span>
                      {elseif condition="$item.cOpinion eq 2"}
                      <span class="label label-warning">Pending</span>
                      {else /}
                      <span class="label label-danger">Denied</span>
                      {/if}
                    </td>
                    <td class="text-center">
                      {if condition="$item.cVerify eq 1"}
                      <span class="label label-success">Approved</span>
                      {elseif condition="$item.cVerify eq 2"}
                      <span class="label label-warning">Pending</span>
                      {else /}
                      <span class="label label-danger">Denied</span>
                      {/if}
                    </td>
                  </tr>
                  {/volist}

                  </tbody>
                </table>
                <!--数据列表/-->

              </div>
              <!-- 数据表格 /-->

            </div>
            <!-- /.box-body -->

          </div>
          <!-- 全部企业 /-->

          <!-- /.box -->
        </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

  <!-- page script -->
  <!-- 内容区域 /-->


</div>

<!-- 引入js依赖 -->
{include file="public/introduce" /}

<script>

  $(document).ready(function() {
    // 选择框
    $(".select2").select2();

    // WYSIHTML5编辑器
    $(".textarea").wysihtml5({
      locale: 'zh-CN'
    });
  });


  // 设置激活菜单
  function setSidebarActive(tagUri) {
    var liObj = $("#" + tagUri);
    if (liObj.length > 0) {
      liObj.parent().parent().addClass("active");
      liObj.addClass("active");
    }
  }


  // 设置激活菜单
  function setSidebarActive(tagUri) {
    var liObj = $("#" + tagUri);
    if (liObj.length > 0) {
      liObj.parent().parent().addClass("active");
      liObj.addClass("active");
    }
  }

  // 激活导航位置
  setSidebarActive("admin-company");

  /* 分页表格开始 */
  $(function() {
    $("#pList").DataTable({
      "searching": true,
      "lengthChange": true,
      "lengthMenu": [　                           //显示几条数据设置
        [5, 10, 20, -1],
        ['5', '10', '20', '全部']
      ],
    });
    $('#aList').DataTable({
      "paging": true,
      "lengthChange": true,
      "searching": true,
      "ordering": true,
      "info": true,
      "autoWidth": false,
      "lengthMenu": [　                           //显示几条数据设置
        [5, 10, 20, -1],
        ['5', '10', '20', '全部']
      ],
    });
  });

  /* 分页表格完 */

</script>
</body>

</html>
<!---->

  {/block}